import {adminUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'

// 创建教材列表
export function createTextbookInfo(data) {
  return request({
    url: adminUrl + '/collegebase/textbook-info/create',
    method: 'post',
    data: data
  })
}

// 更新教材列表
export function updateTextbookInfo(data) {
  return request({
    url: adminUrl + '/collegebase/textbook-info/update',
    method: 'put',
    data: data
  })
}

// 删除教材列表
export function deleteTextbookInfo(id) {
  return request({
    url: adminUrl + '/collegebase/textbook-info/delete?id=' + id,
    method: 'delete'
  })
}

// 获得教材列表
export function getTextbookInfo(id) {
  return request({
    url: adminUrl + '/collegebase/textbook-info/get?id=' + id,
    method: 'get'
  })
}

// 获得教材列表分页
export function getTextbookInfoPage(query) {
  return request({
    url: adminUrl + '/collegebase/textbook-info/page',
    method: 'get',
    params: query
  })
}

// 获得所有教材列表分页
export function getTextbookInfoallList() {
  return request({
    url: adminUrl + '/collegebase/textbook-info/allList',
    method: 'get',
  })
}

// 导出教材列表 Excel
export function exportTextbookInfoExcel(query) {
  return request({
    url: adminUrl + '/collegebase/textbook-info/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

//获取教材分类树形
export function textbookTypeTree() {
  return request({
    url: adminUrl + '/collegebase/textbook-type/tree/list',
    method: 'get',

  })
}

